package com.young.rabbitmq.callback;

import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.amqp.rabbit.core.RabbitTemplate;

public class MsgSendConfirmCallBack implements RabbitTemplate.ConfirmCallback {

    public void confirm(CorrelationData correlationData, boolean ack, String cause) {
        if (ack) {
            System.out.println("confirm方法回调成功，消息发送成功....");
        } else {
            //处理丢失的消息
            System.out.println("onfirm方法回调成功，消息发送失败," + cause);
        }
    }
}
